#!/bin/bash

# YOLOs-CPP-EdgePlatform Build Script for RDKx5

echo "=== Building YOLOs-CPP-EdgePlatform ==="

# Create build directory
mkdir -p build
cd build

# Configure CMake
echo "Configuring CMake..."
cmake .. -DCMAKE_BUILD_TYPE=Release

# Compile
echo "Compiling..."
make -j$(nproc)

# Check build result
if [ $? -eq 0 ]; then
    echo ""
    echo "=== Build Successful! ==="
    echo "Executable: build/yolo11_demo"
    echo ""
    echo "Usage:"
    echo "  ./yolo11_demo <model.bin> <image.jpg> [labels.txt]"
else
    echo ""
    echo "=== Build Failed! ==="
    exit 1
fi
